﻿using System;

namespace 委托
{
	class Program
	{
		public delegate string DelProStr(string name);
		static void Main(string[] args)
		{
			//全部转换大写或者小写或者加 ""
			//正常需要写3个方法
			string[] names = { "asdaDSAC", "SAHCGJh", "jdwhWdsXAS" };
			//ProLower(names);
			//ProUpper(names);

			//匿名函数
			//delegate (string name)
			//{
			//	return name.ToLower();
			//});
			Pro(names, delegate (string name)
			{
				return name.ToLower();
			});


			foreach (var item in names)
			{
				Console.WriteLine(item);
			}

			Console.ReadKey();
		}
		public static void Pro(string[] name,DelProStr del)
		{
			for (int i = 0; i < name.Length; i++)
			{
				name[i] = del(name[i]);
			}
		}
		//public static string StrToUpper(string name)
		//{
		//	return name.ToUpper();
		//}
		//public static string StrToLower(string name)
		//{
		//	return name.ToLower();
		//}
		//public static string SSH(string name)
		//{
		//	return "\"" + name + "\"";
		//}
	

		//public static void ProUpper(string[] name)
		//{
		//	for (int i = 0; i < name.Length; i++)
		//	{
		//		name[i] = name[i].ToUpper();
		//	}
		//}
		//public static void ProLower(string[] name)
		//{
		//	for (int i = 0; i < name.Length; i++)
		//	{
		//		name[i] = name[i].ToLower();
		//	}
		//}
		//public static void ProStr(string[] name)
		//{
		//	for (int i = 0; i < name.Length; i++)
		//	{
		//		name[i] = "\"" + name[i] + "\"";
		//	}
		//}
	}
}
